//
//  BaseViewController.m
//  觅影
//
//  Created by  陶虹 on 16/4/7.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()
@property (nonatomic, copy) NSArray *gesArray;

@end

@implementation BaseViewController

-(void)viewWillAppear:(BOOL)animated {
   
    [super viewWillAppear:animated];
    // 获取所有手势
    self.gesArray = self.tabBarController.view.gestureRecognizers;
    // 界面将要出现时 清除手势
    for (UIGestureRecognizer *ges in self.tabBarController.view.gestureRecognizers) {
        //if ([ges isKindOfClass:[UIPanGestureRecognizer class]]) {
            [self.tabBarController.view removeGestureRecognizer:ges];
        //}
    }
}

// 界面将要消失的时候 添加手势
-(void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    for (UIGestureRecognizer *ges in self.gesArray) {
        //if ([ges isKindOfClass:[UIPanGestureRecognizer class]]) {
            [self.tabBarController.view addGestureRecognizer:ges];
        //}
      }
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
